/* jshint indent: 1 */

module.exports = function(sequelize, DataTypes) {
	return sequelize.define('stu_task', {
		stu_id: {
			type: DataTypes.INTEGER,
			allowNull: false,
			primaryKey: true,
			references: {
				model: {
					tableName: 'student',
				},
				key: 'stu_id'
			}
		},
		course_id: {
			type: DataTypes.INTEGER,
			allowNull: false,
			primaryKey: true,
			references: {
				model: {
					tableName: 'course',
				},
				key: 'course_id'
			}
		},
		submit_date: {
			type: DataTypes.DATEONLY,
			allowNull: true
		},
		grade: {
			type: DataTypes.FLOAT,
			allowNull: true
		},
		path: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		name: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		is_over: {
			type: DataTypes.STRING(2),
			allowNull: true
		},
		remark: {
			type: DataTypes.STRING(255),
			allowNull: true
		}
	}, {
		sequelize,
		tableName: 'stu_task',
		timestamps: false
	});
};
